﻿@model DroidClaim.Web.Models.ClaimInfoModel
@using DroidClaim.Web.CustomHelpers
@using DroidClaim.Web.Mapper
@{
    ViewBag.Title = "Add ClaimInfo";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
}

@section Styles {
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/form.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        $(function () {
            //How to setup Datepicker
            // SetDatePicker has 4 argurement
            // controlId -> id of control
            // maxdate -> maximun Date that can be selected 
            // mindate -> minimum Date that can be selected 
            // yearrange - > range of year
            // more information see http://api.jqueryui.com/datepicker/
            				SetDatePicker("AccidentDate", new Date(), '-71Y', 'c-70:c');
							SetDatePicker("UpdateDate", new Date(), '-71Y', 'c-70:c');
			            //ถ้าไม่มีกำหนด maxdate, mindate, yearrange
            SetDatePicker("FreeDate");


            //How to setup Lookup
            // SetLookupFor has 3 argurement
            // controlId -> id of control
            // getLookupId -> hidden control's id for getlookup link
            // popLookupId -> hidden control's id for poplookup link
            				SetLookupFor("ClaimInfo_ClaimStatus", "ClaimInfo_ClaimStatusGetLookup", "ClaimInfo_ClaimStatusPopLookup");
							SetLookupFor("ClaimInfo_CliamDoc", "ClaimInfo_CliamDocGetLookup", "ClaimInfo_CliamDocPopLookup");
							SetLookupFor("ClaimInfo_Customer", "ClaimInfo_CustomerGetLookup", "ClaimInfo_CustomerPopLookup");
							SetLookupFor("ClaimInfo_Surveyor", "ClaimInfo_SurveyorGetLookup", "ClaimInfo_SurveyorPopLookup");
							SetLookupFor("ClaimInfo_ClaimNumber", "ClaimInfo_ClaimNumberGetLookup", "ClaimInfo_ClaimNumberPopLookup");
			
        });
    </script>
}

<h2>New ClaimInfo</h2>


@using (Html.BeginForm("AddClaimInfo", "ClaimInfo")) {
    @Html.ValidationSummary(false)
    <fieldset>
        <legend>ClaimInfoModel</legend>
		<div class="two-column-container">		
					
			 
			
			             <div class="texteditor">
                @Html.LabelFor(model => model.AccidentDate)
                @Html.DatePickerFor(model => model.AccidentDate, "AccidentDate")
                            </div>
			
						 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.AccidentLocation)
				@Html.EditorFor(model => model.AccidentLocation)
							</div>

								
					
			 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.Latitude)
				@Html.EditorFor(model => model.Latitude)
							</div>

						 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.Longitude)
				@Html.EditorFor(model => model.Longitude)
							</div>

								
					
			 
			
			             <div class="texteditor">
                @Html.LabelFor(model => model.UpdateDate)
                @Html.DatePickerFor(model => model.UpdateDate, "UpdateDate")
                            </div>
			
						 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.AccImgPath)
				@Html.EditorFor(model => model.AccImgPath)
							</div>

								
					
			 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.CliamDocImgPath)
				@Html.EditorFor(model => model.CliamDocImgPath)
							</div>

						 
			
					
            <div class="texteditor">
                @Html.LabelFor(model => model.ClaimStatus) 
				@Html.Lookup("ClaimInfo_ClaimStatus").For(model => model.ClaimStatus).WithCode(model => model.ClaimStatusCode).WithName(model => model.ClaimStatusName).Render()  
                            </div>
			
								
					
			 
			
					
            <div class="texteditor">
                @Html.LabelFor(model => model.CliamDoc) 
				@Html.Lookup("ClaimInfo_CliamDoc").For(model => model.CliamDoc).WithCode(model => model.CliamDocCode).WithName(model => model.CliamDocName).Render()  
                            </div>
			
						 
			
					
            <div class="texteditor">
                @Html.LabelFor(model => model.Customer) 
				@Html.Lookup("ClaimInfo_Customer").For(model => model.Customer).WithCode(model => model.CustomerCode).WithName(model => model.CustomerName).Render()  
                            </div>
			
								
					
			 
			
					
            <div class="texteditor">
                @Html.LabelFor(model => model.Surveyor) 
				@Html.Lookup("ClaimInfo_Surveyor").For(model => model.Surveyor).WithCode(model => model.SurveyorCode).WithName(model => model.SurveyorName).Render()  
                            </div>
			
						 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.Code)
				@Html.EditorFor(model => model.Code)
				<input type="hidden" name="Mode" value="Add" />			</div>

								
					
			 
			
						<div class="texteditor">
				@Html.LabelFor(model => model.Name)
				@Html.EditorFor(model => model.Name)
							</div>

						 
			
					
            <div class="texteditor">
                @Html.LabelFor(model => model.ClaimNumber) 
				@Html.Lookup("ClaimInfo_ClaimNumber").For(model => model.ClaimNumber).WithCode(model => model.ClaimNumberCode).WithName(model => model.ClaimNumberName).Render()  
                            </div>
			
								
				       
        <div class="bottom-menu clear">
            <input type="submit" value="Add" />
            <input id="cancel" onclick="location.href='@Url.Action("ListClaimInfo", "ClaimInfo")'" type="button" value="Cancel" />
        </div>
    </fieldset>
}